'use strict';

const Controller = require('egg').Controller;

class ApilistController extends Controller {
  // 查询所有api
  async showAllApiList() {
    const { ctx } = this
    const result = await ctx.service.api.showAllApi()
    ctx.body = {
      code: 1,
      result
    }
  }

  async getApilistByProjectid() {
    const { ctx } = this
    const projectId = ctx.params.projectid
    const result = await ctx.service.api.findApiByProjectId(projectId)
    console.log(result)
    ctx.body = {
      result
    }
  }
}

module.exports = ApilistController;
